#ifndef Bike_Display_SystemSetup_Functions_H_
#define Bike_Display_SystemSetup_Functions_H_

#include <plib.h>

#define ICONGRIDPOSX1       0
#define ICONGRIDPOSY1       0
#define ICONGRIDPOSX2       0
#define ICONGRIDPOSY2       35
#define ICONGRIDPOSX3       0
#define ICONGRIDPOSY3       70
#define ICONGRIDPOSX4       160
#define ICONGRIDPOSY4       5
#define ICONGRIDPOSX5       160
#define ICONGRIDPOSY5       40
#define ICONGRIDPOSX6       160
#define ICONGRIDPOSY6       75

#define VALUEGRIDPOSX1      45
#define VALUEGRIDPOSY1      0
#define VALUEGRIDPOSX2      45
#define VALUEGRIDPOSY2      35
#define VALUEGRIDPOSX3      45
#define VALUEGRIDPOSY3      70
#define VALUEGRIDPOSX4      208
#define VALUEGRIDPOSY4      0
#define VALUEGRIDPOSX5      208
#define VALUEGRIDPOSY5      35
#define VALUEGRIDPOSX6      208
#define VALUEGRIDPOSY6      70

#define UNITGRIDPOSX1       105
#define UNITGRIDPOSY1       0
#define UNITGRIDPOSX2       105
#define UNITGRIDPOSY2       35
#define UNITGRIDPOSX3       105
#define UNITGRIDPOSY3       70
#define UNITGRIDPOSX4       270
#define UNITGRIDPOSY4       0
#define UNITGRIDPOSX5       270
#define UNITGRIDPOSY5       35
#define UNITGRIDPOSX6       270
#define UNITGRIDPOSY6       70

#define UNITMEDIUMX         270
#define UNITMEDIUMY         45

#define UNITBOTTOMX         270
#define UNITBOTTOMY         170

// Bike specific constants
#define ENGINECOLD          140
#define ENGINEHOT           220
#define OILCOLD             100
#define OILHOT              150
#define SPEEDLOW            30
#define SPEEDHIGH           80
#define REVLOW              1050
#define REVHIGH             6500
#define REVMAXLIMIT         7000
#define REVBARX1            0
#define REVBARY1            220
#define REVBARX2            320
#define REVBARY2            240

#define TPSPERCENTMIN       6

#define MAXVOLTAGE          13650   // Value to be entered in mV to ease calculation
#define MINVOLTAGE          11500   // Value to be entered in mV to ease calculation

/*
typedef struct
{
    int red;
    int green;
    int blue;
}bitmap_address_colour;

typedef struct
{
    bitmap_address_colour small;
    bitmap_address_colour medium;
    bitmap_address_colour large;
}bitmap_size;    

extern bitmap_size* bitmap_char[12];
*/

// Function proto types
void MainSetup(void);
char DisplaySetup(void); //(char cDataToDisplay, char cGridPosition)
char DisplayEngineTemp(int nNewEngineTemp);
char DisplayOilTemp(int nNewOilTemp);
char DisplaySpeed(int nNewSpeed);
char DisplayRevs(int nNewRevs);
char DisplayRevsBar(int nNewRevs);
void ScanDigitalSignalsFromBike(void);
void MeasureBatteryVoltage(void);
void MeasureOilTemperature(void);

#endif

